package com.niiwoo.civet.trade.dao.mapper;

import com.niiwoo.civet.trade.dao.entity.ProjectCreditorFund;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface ProjectCreditorFundMapperExt extends ProjectCreditorFundMapper{

    /**
     * 查询所有待清偿期数的债权列表
     * 债务人维度
     * @param projectId
     * @return
     */
    List<ProjectCreditorFund> listWaitingSettleCreditor(Long projectId);

    /**
     * 根据项目id和还款期数获取 还款计划详情
     * @param projectId
     * @param repayNo
     * @return
     */
    ProjectCreditorFund selectByProjectIdAndPeriod(@Param("projectId") Long projectId, @Param("repayNo")Integer repayNo);

    /**
     * 更新债权状态为清偿.
     *
     * @param creditorFund 债权对象
     * @return 影响行数
     */
    int updateCreditorStatus2Settlement(ProjectCreditorFund creditorFund);
}